import { useNavigate } from 'react-router-dom'
import { Menu } from 'antd'

const items = [
  {
    label: '仪表盘',
    key: 'dashboard'
  },
  {
    label: '数据集',
    key: 'dataset'
  }
]

const Header = () => {
  const navigate = useNavigate()

  const onNavigate = ({ key }) => {
    navigate(`/${key}`)
  }

  return (
    <Menu
      mode="horizontal"
      defaultSelectedKeys={['dashboard']}
      items={items}
      onClick={onNavigate}
    />
  )
}

export default Header
